package models

import "gorm.io/gorm"

type Product struct {
	gorm.Model
	Name          string `gorm:"type:varchar(50)"`
	Content       string `gorm:"type:varchar(50)"`
	DownLoadCount int    `gorm:"type:int"`
}

type Type struct {
	gorm.Model
	TypeName string `gorm:"type:varchar(50)"`
}

type ProductType struct {
	gorm.Model
	Pid int `gorm:"type:int"`
	Tid int `gorm:"type:int"`
}

type User struct {
	gorm.Model
	Username string `gorm:"type:varchar(50)"`
	Password string `gorm:"type:varchar(50)"`
}

type DownLoad struct {
	gorm.Model
	ProductID int     `gorm:"type:int"json:"product_id"`
	Product   Product `gorm:"foreignKey:ProductID"json:"product"`
	UserID    int     `gorm:"type:int"json:"user_id"`
	User      User    `gorm:"foreignKey:UserID"json:"user"`
}
